# 练习1 查找元音字母出现的次数

vowels = ['a', 'e', 'i', 'o', 'u']
word = input("请输入一段您想寻找元音字母的英文句子或单词: ")
found = {}
found['a'] = 0
found['e'] = 0
found['i'] = 0
found['o'] = 0
found['u'] = 0

for letter in word:
    if letter in vowels:
        found[letter] += 1

for k,v in sorted(found.items()):
    print(k,'出现了',v,'次。')

# 练习2 依次输出单词里的元音字母

word = "xinshijie_huachenyu"

for letter in word:

    if letter in vowels:
        print(letter,end=" ")
print(' ')

# 练习3 查找关键词

word = input("请输入你想查找关键词/元音的语句：")
found = []
for letter in word:
    if letter in vowels:
        if letter not in found:
            found.append(letter)
    else:
        print("没有发现元音字母。")
        break #记得写break 否则你有多少个字符它就会循环多少次。
for vowel in found:
    print(vowel)

